package com.elock.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.elock.base.core.controller.BaseController;
import com.elock.base.core.controller.ResultMsg;
import com.elock.base.core.util.WebUtils;

/**
 * Controller - 会员注销
 * @author 仁德
 */
@Controller("logoutController")
public class LogoutController extends BaseController {

	/**
	 * 注销
	 */
	@RequestMapping(value = "/logout", method = RequestMethod.POST)
	public @ResponseBody ResultMsg logout(HttpServletRequest request,
			HttpServletResponse response) {

		WebUtils.removePrincipal();
		return success().addObjX("/login.jhtml");
	}

}